﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ChietTinhQuaTang.aspx.cs" Inherits="DLV.BackEnd.Pages.ChietTinhQuaTang" %>


<%@ Import Namespace="System.Globalization" %>
<%@ Import Namespace="DLV.Data.Entities" %>
<%@ Import Namespace="DLV.Library.Utilities" %>

<asp:content id="Content1" contentplaceholderid="placeHolderContent" runat="server">
    <style>
        .report {
            margin-top: 40px;
        }

        .head {
            width: 100%;
            overflow: hidden;
        }

            .head > .logo {
                width: 20%;
                float: left;
                margin-right: 1%;
            }

                .head > .logo img {
                    display: block;
                    margin: 0 auto;
                }

            .head > .table {
                width: 78%;
                float: right;
            }

                .head > .table > table {
                    width: 100%;
                    border-top: 1px solid #000;
                    border-left: 1px solid #000;
                }

                    .head > .table > table th {
                        padding: 0px 0;
                        font-size: 20px;
                        border-bottom: 1px solid #000;
                        border-right: 1px solid #000;
                        background-color: #F2DCDB;
                    }

                    .head > .table > table td {
                        padding: 7px;
                        border-bottom: 1px solid #000;
                        border-right: 1px solid #000;
                    }

        .service {
            width: 100%;
            margin-top: 20px;
        }

            .service > table {
                width: 100%;
                margin-bottom: 20px;
                border-top: 1px solid #000;
                border-left: 1px solid #000;
            }

                .service > table th {
                    padding: 5px 0;
                    border-bottom: 1px solid #000;
                    border-right: 1px solid #000;
                    background: #F2DCDB;
                }

                    .service > table th.first {
                        background-color: #92CDDC;
                        width: 8%;
                    }

                .service > table td {
                    padding: 7px;
                    border-bottom: 1px solid #000;
                    border-right: 1px solid #000;
                }

                .service > table .tr {
                    text-align: right;
                }

        div {
            margin: 0;
            padding: 0;
        }
    </style>
    <div class="report">
        <div class="head">
            <div class="logo">
                <a href="http://dulichviet.com.vn"><img src="/images/logo.png" /></a>
            </div>    
            <div class="table">
                <table cellpadding="0" cellspacing="0" border="0">
                    <tr>
                        <th colspan="4">BẢNG TÍNH GIÁ</th>
                    </tr>
                    <tr>
                        <td><b>Tên đoàn</b></td>
                        <td><%=tourInfo.TourName%></td>
                        <td><b>Code đoàn</b></td>
                        <td>DLV<%=tourInfo.TourId%></td>
                    </tr>
                    <tr>
                        <td><b>Loại hình đoàn</b></td>
                        <td><%=tourInfo.GroupType%></td>
                        <td><b>Loại tour</b></td>
                        <td><%=tourInfo.TourTypeId%></td>
                    </tr>
                    <tr>
                        <td><b>Điểm khởi hành</b></td>
                        <td><%=tourInfo.LocationBegin%></td>
                       </tr>
                    <tr>
                        <td><b>Số lượng khách</b></td>
                        <td>Người lớn: <%=tourInfo.QuantityAdult%> | Trẻ em: <%=tourInfo.QuantityChild%> | Trẻ nhỏ: <%=tourInfo.QuantityBaby%></td>
                        <td><b>Đối tượng khách</b></td>
                        <td>Chọn đối tượng khách</td>
                    </tr>
                    <tr>
                        <td><b>Số hướng dẫn viên</b></td>
                        <td>Chọn số</td>
                        <td><b>Yêu cầu</b></td>
                        <td>Chọn loại HDV</td>
                    </tr>
                    <tr>
                        <td><b>Ngày khởi hành</b></td>
                        <td><%=tourInfo.BeginDate%></td>
                        <td><b>Ngày kết thúc</b></td>
                        <td><%=tourInfo.EndDate%></td>
                    </tr>
                    <tr>
                        <td><b>Tổng số ngày</b></td>
                        <td><%=tourInfo.QuantityDay%></td>
                        <td><b>Tổng số đêm</b></td>
                        <td><%=tourInfo.QuantityNight%></td>
                    </tr>
                     <tr>
                        <td><b>Mùa</b></td>
                        <td><%=tourInfo.Season%></td>
                        <td><b>Thị trường</b></td>
                        <td><%=tourInfo.MartName%></td>
                    </tr>
                </table>
            </div>
        </div>  
        
    <div class="service">
                            <table cellpadding="0" cellspacing="0" border="0">
                                <tr>
                                    <th rowspan="2" class="first">QUÀ TẶNG </th>
                                    <th rowspan="2">LOẠI QUÀ TẶNG</th>
                                    <th rowspan="2">TÊN QUÀ TẶNG</th>
                                    <th rowspan="2">SỐ NGÀY</th>
                                    <th colspan="3">QUÀ TẶNG/NGÀY</th>
                                    <th colspan="3">CHI PHÍ</th>
                                    <th colspan="3">SỐ KHÁCH</th>
                                    <th rowspan="2">TỔNG</th>
                                    <th rowspan="2">VAT</th>
                                    <th rowspan="2">GHI CHÚ</th>
                                    <th rowspan="2"></th>
                                </tr>
                                <tr>
                                    <th>NL</th>
                                    <th>TE</th>
                                    <th>TN</th>
                                     <th>NL</th>
                                    <th>TE</th>
                                    <th>TN</th> 
                                    <th>NL</th>
                                    <th>TE</th>
                                    <th>TN</th>
                                </tr>

                                <% foreach (DLV.Data.Entities.CalculatorInfo calculatorGifts in GiftsList)
                                   { %>
                                <tr class="ListGifts" id="Gifts-<%=calculatorGifts.CalculatorId%>">
                                    <td></td>
                                    <td><%=calculatorGifts.GiftsTypeName %></td>
                                    <td><%=calculatorGifts.GiftsName %></td>
                                    <td><%=calculatorGifts.QuantityCar %></td>
                                    <td><%=calculatorGifts.TranslateAdult %></td>
                                    <td><%=calculatorGifts.TranslateChild %></td>
                                    <td><%=calculatorGifts.TranslateBaby %></td>
                                    <td><%=calculatorGifts.PriceAdults %></td>
                                    <td><%=calculatorGifts.PriceChild %></td>
                                    <td><%=calculatorGifts.PriceBaby %></td>
                                    <td><%=calculatorGifts.QuantityAdults %></td>
                                    <td><%=calculatorGifts.QuantityChild %></td>
                                    <td><%=calculatorGifts.QuantityBaby %></td>
                                    <td><%=calculatorGifts.TotalPriceGifts.ToString("#,###", new CultureInfo("vi-VN")) %></td>
                                    <td><%=calculatorGifts.Vat %></td>
                                    <td><%=calculatorGifts.Note %></td>
                                    <td>
                                        <input class="btnUpdateGifts"  type="button" value="Cập nhật" calculatorid="<%=calculatorGifts.CalculatorId%>" />
                                        <input class="btnDeleteGifts"  type="button" value="Xóa" calculatorid="<%=calculatorGifts.CalculatorId%>" />
                                    </td>
                                </tr>
                
                                <%} %>
                                <tr></tr>
                                 <tr id="new-ticket-gifts">
                                     <td></td>
                                    <td><asp:DropDownList ID="ddlGiftsType" runat="server" Width="100px"></asp:DropDownList></td>
                                    <td><asp:DropDownList ID="ddlGifts" runat="server" Width="100px"></asp:DropDownList></td>
                                   
                                     <td><asp:TextBox id="txtTotalDay" runat="server" Width="35px"></asp:TextBox></td>
                                     <td><asp:TextBox id="txtNLDay" runat="server" Width="35px"></asp:TextBox></td>
                                    <td><asp:TextBox id="txtTEDay" runat="server" Width="35px"></asp:TextBox></td>
                                     <td><asp:TextBox id="txtTNDay" runat="server" Width="35px"></asp:TextBox></td>
                                   
                                    <td><asp:TextBox id="txtPriceAdultGifts" runat="server" Width="35px"></asp:TextBox></td>
                                    <td><asp:TextBox id="txtPriceChildGifts" runat="server" Width="35px"></asp:TextBox></td>
                                     <td><asp:TextBox id="txtPriceBabyGifts" runat="server" Width="35px"></asp:TextBox></td>
                                    <td><asp:TextBox id="txtQuantityAdultGifts" runat="server" Width="35px"></asp:TextBox></td>
                                    <td><asp:TextBox id="txtQuantityChildGifts" runat="server" Width="35px"></asp:TextBox></td>
                                     <td><asp:TextBox id="txtQuantityBabyGifts" runat="server" Width="35px"></asp:TextBox></td>
                                    <td><asp:Label id="lbTotalPriceGifts" runat="server" Width="50px"></asp:Label></td>
                                     <td><asp:TextBox ID="txtVATGifts" runat="server" Width="50px"></asp:TextBox></td>
                                     <td><asp:TextBox ID="txtNote" runat="server" Width="50px"></asp:TextBox></td>
                                    <td id="toolbar-save" class="button">
						                 <input  id="btnInsertGifts" class="btnsave" type="button" value="Thêm" calculatorid="-1"/>
                                        <input id="btnDeleteGifts" class="btnDeleteGifts"  type="button" value="Hủy" calculatorid="-1" />
					                </td>
                                </tr>
                                
                                <tr>
                                    <td colspan="13"><b>TỔNG CHI PHÍ/ KHÁCH NGƯỜI LỚN</b></td>
                                    <td class="tr" id="TotalGiftsPricesAdults"><%=TotalGiftsPricesAdults.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td colspan="13"><b>TỔNG CHI PHÍ/ KHÁCH TRẺ EM</b></td>
                                    <td class="tr" id="TotalGiftsPricesChild"><%=TotalGiftsPricesChild.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td colspan="13"><b>TỔNG CHI PHÍ/ KHÁCH TRẺ NHỎ</b></td>
                                    <td class="tr" id="TotalGiftsPricesBaby"><%=TotalGiftsPricesBaby.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td colspan="13"><b>TỔNG CHI PHÍ ĐOÀN</b></td>
                                    <td class="tr" id="TotalGiftsPrices"><%=TotalGiftsPrices.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                                    <td id="TotalVatGifts"><%=TotalVatGifts.ToString() %></td>
                                </tr>
                            </table>
                        </div>

   </div>
    <script src="../js/jquery.ChietTinhQuaTang.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            InsertCalculatorGifts('#<%=ddlGiftsType.ClientID%>', '#<%=ddlGifts.ClientID%>', 
                                '#<%=txtTotalDay.ClientID%>', '#<%=txtNLDay.ClientID%>',
                                '#<%=txtTEDay.ClientID%>', '#<%=txtTNDay.ClientID%>',
                                '#<%=txtPriceAdultGifts.ClientID%>', '#<%=txtPriceChildGifts.ClientID%>',
                                '#<%=txtPriceBabyGifts.ClientID%>', '#<%=txtQuantityAdultGifts.ClientID%>',
                                '#<%=txtQuantityChildGifts.ClientID%>', '#<%=txtQuantityBabyGifts.ClientID%>',
                                '#<%=txtVATGifts.ClientID%>', '#<%=txtNote.ClientID%>',
                                '#<%=lbTotalPriceGifts.ClientID%>', '<%=tourInfo.TourId%>');
        });
    </script>
</asp:content>


